package com.zhuangjie.mvc.sse.service;

import com.zhuangjie.event.service.ModuleEventService;
import com.zhuangjie.mvc.sse.entity.SSEResult;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import java.io.IOException;

public interface SSEService<K> extends ModuleEventService {
    SseEmitter listen(K targetId) throws IOException;

    void remove(K targetId);

    void send(K targetId, SSEResult sseResult) throws IOException;

    void startMaintenance();
}
